#!/bin/bash
user=$1
token=$2
jumper=$3
code="$(java -jar -Dtoken=$token /Users/free8rt/IdeaProjects/totp2/src/main/resources/totp.jar)"
expect -c "
spawn ssh -p6088 ${user}@${jumper}
expect {
	\"failed.\" {exit}
	\"*ID>:*\" {send \"1.163\n\";exp_continue}
	\"*口令:*\" {send \"${code}\r\";exp_continue}
	\"*163-1-163*\" {send \"sudo su -\r\"}
}
interact
"
